
<template>

    <div>

        <mu-container>

            <mu-grid-list class="gridlist">

                <mu-sub-header> 推荐服务商 </mu-sub-header>
                <mu-grid-tile v-for="item,index in server"
                              title-position="bottom"
                              action-position="left" >
                    <a :href="'#/good/index?server_id='+item.id">
                        <img :src="item.avatar"/>
                    </a>
                        <span slot="title">{{item.name}}</span>
                </mu-grid-tile>





                <mu-sub-header> 推荐雇主 </mu-sub-header>
                <mu-grid-tile v-for="item,index in employ"
                              title-position="bottom"
                              action-position="left">
                    <a :href="'#/purchase/index?server_id='+item.id">
                    <img :src="item.avatar"/>
                    </a>
                    <span slot="title">{{item.name}}</span>

                </mu-grid-tile>





            </mu-grid-list>

        </mu-container>
        <toolbar :value="'home'"></toolbar>
    </div>

</template>

<script>
    import toolbar from "@/view/common/toolbar"
    export default {
        name: 'index',
        data () {
            return {
                employ:[],
                server:[],
                purchase:[],
                good:[],
            }
        },
        mounted(){
            this.load_server();
            this.load_employ();
        },
        methods:{
            load_employ(){
                let $this = this;
                $this.$api.employ_list({},function(resp){
                    if(resp.code == 0){
                        $this.employ = resp.data.data;
                    }else{
                        this.$toast.error(resp,msg);
                    }
                });
            },
            load_server(){
                let $this = this;
                $this.$api.server_list({},function(resp){
                    if(resp.code == 0){
                        $this.server = resp.data.data;
                    }else{
                        this.$toast.error(resp,msg);
                    }
                });
            },
        },
        components:{
            toolbar
        }
    }
</script>

<style>
    .gridlist{
        text-align: center;
    }
</style>